package swing;

import javax.swing.*;
import java.awt.*;

/**
 * @author Mark
 * @version 1.0
 * @date 2020/5/17 10:27
 * @description 测试类
 */
public class AppTest {

    public static void main(String[] args) {
        new DialogTest();
    }
}

class DialogTest extends JFrame {
    DialogTest() {
        this.setVisible(true);
        this.setSize(100, 200);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        Container contentPane = this.getContentPane();
        contentPane.setLayout(null);
        JButton jButton = new JButton("点击了一个对话框");
        jButton.setBounds(30, 30, 200, 50);
        contentPane.add(jButton);
    }

}

class MyDialog extends JDialog {
    public MyDialog() {
        this.setVisible(true);
        this.setBounds(100, 100, 500, 500);
        Container contentPane = this.getContentPane();
        contentPane.setLayout(null);
        contentPane.add(new Label("学swing"));
    }
}